home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / cxref200.zip / CXREF.DOC < prev    next >
Text File  |  1993-01-04  |  6KB  |  136 lines

  1.            CXREF - C Program Cross Reference Generator
  2.                   Version: 2.00     June 24, 1986
  3.  
  4.  
  5.     CXREF produces a cross-reference listing for a C program  and 
  6. optional  graphical  representation of the block structure of the 
  7. program.  Occurrences only are listed.  No  distinction  is  made 
  8. between  definitions  and  references.  Version 2.00 of CXREF has 
  9. been converted from Turbo Pascal source  into  C  source.  The  C 
  10. compiler  used  was  Datalight's small model compiler however the 
  11. source appears to be reasonably standard and little effort should 
  12. be required to convert it to any other C.  
  13.  
  14.  
  15. USAGE:
  16.  
  17.     The command line for CXREF has the following format:
  18.  
  19.         CXREF input_file_name [output_file_name] [options]
  20.  
  21.     Both the input_file_name and the output_file_name may be full 
  22. PC/MS-DOS path names.  The output_file_name is  optional.  If  is 
  23. is  not  supplied,  the output file will be created with the same 
  24. name as the input file but  with  an  extension  of  LST.  If  no 
  25. extension  is  specified  for the input file,  an extension of .C 
  26. will be assumed.  If an output file name is specified but without 
  27. an extension, an extension of LST will be assumed.  
  28.  
  29.     The current version of CXREF supports three flag options and 
  30. two options that require an additional parameter.
  31.  
  32.     Flag Options:
  33.  
  34.         -NL  - Suppress  the  graphical  representation  of   the 
  35.                program  and  the  line  numbered  listing  of the 
  36.                program.  
  37.  
  38.         -NS  - Suppress cross-referencing of C keywords.
  39.  
  40.         -NI  - Suppress analysis of #include files.
  41.  
  42.     Value Options:
  43.  
  44.         -I <path>  - Supplies the path for  #include  <file_name> 
  45.                      files.  Must b followed by the pathname.  
  46.  
  47.         -T <n>     - Sets  the  tab stop value for tab expansion.  
  48.                      The default value is 4.  
  49.  
  50.     The  default  condition  is  to  produce  the  line  numbered 
  51. listing,   including  all  #include  files,   showing  the  block 
  52. structure and to cross-reference all symbols.  
  53.  
  54.     If executed with  no  command  line  parameters,  CXREF  will 
  55. display a brief summary of its usage.  
  56.  
  57.  
  58. INCLUDE FILES:
  59.  
  60.     This version of CXREF will process single level include files 
  61. of  either  the  quote  delimited  or the angle bracket ['<','>'] 
  62. forms.  Quote delimited include files are  located  in  the  same 
  63. directory  as  the  input  program  and  angle  bracket delimited 
  64. include   files   are   located   in   a   "system"    directory.  
  65. Unfortunately,  there  is  no  standard  "system" directory under 
  66. PC/MS-DOS and the various C compilers use a number  of  different 
  67. mechanisms  to  provide  a  "system"  directory.  To  handle  the 
  68. different "system" directories, CXREF provides the "-I" option on 
  69. the command line,  allowing the user to provide a  path  for  all 
  70. angle bracket delimited include files.  
  71.  
  72.     CXREF can handle up to 26 include files, distinguished by the 
  73. letters  A  through  Z  following  the  line  numbers in both the 
  74. listing and the cross-reference.  The line numbers shown, both on 
  75. the listing and in the cross-reference,  are  true  line  numbers 
  76. within  the  file  making the cross-reference without the listing 
  77. useful.  
  78.  
  79.  
  80.  
  81. HISTORY OF DEVELOPMENT:
  82.  
  83.     This program has  had  a  long  history.  It  was  originally 
  84. written  for  Pascal  programs  by N.  Wirth using the "quadratic 
  85. quotient" hash method.  It was adapted for UCSD Pascal (1.4 - the 
  86. public  domain  version)  by  Shawn   Fanning   (in   1978)   and 
  87. subsequently  adapted  for  Pascal/MT+  by Mike Lehman (in 1981).  
  88. This version was then modified by Warren A.  Smith to try to  get 
  89. back  to ISO standard Pascal and to add the additional feature of 
  90. mapping out the compound statements.  It was modified  for  Turbo 
  91. Pascal  by  Ron  Finger in July,  1984.  This last version of the 
  92. program, at least, was named XLIST.  
  93.  
  94.     Further modifications were made by Larry Dodson in September, 
  95. 1985.   These  include  the  ability  to  handle  Include  files, 
  96. expansion   of   the   identifier  field  from  eight  to  twelve 
  97. characters,  optional  suppression  of  the  output  of  standard 
  98. identifiers,  a margin on the left of the output to provide space 
  99. to punch holes for a three-ring binder, and a compile time option 
  100. of 66 or 88 lines per page.  In addition,  several comments  were 
  101. added,  blocking  (for  readability)  was improved,  the name was 
  102. changed from XLIST  to  XREF,  and  several  other  less  evident 
  103. corrections  and  modifications were incorporated.  These changes 
  104. were made and tested using Turbo Pascal (Version 2.0 for CP/M 80) 
  105. on a Kaypro II with an Okidata 82 printer.  
  106.  
  107.     NXREF was then produced by  Don  Williams  as  practically  a 
  108. complete  rewrite  of  XREF.  Binary  trees  were  used  for  the 
  109. references rather than the 'quadratic quotient' used by XREF (the 
  110. binary tree routines used,  however,  are simple  adaptations  of 
  111. those  presented  by  N.  Wirth  in  his  excellent  book,  "Data 
  112. Structures + Algorithms = Programs".) The program was modified to 
  113. take advantage of the Turbo Pascal  3.0  Command  Line  parameter 
  114. features.  The  case  structure  of  the  first  occurrence of an 
  115. identifier  was  preserved  (XREF   and   XLIST   converted   all 
  116. identifiers to upper case in the cross-reference.  
  117.  
  118.     Use  of  the  binary  tree  routines  and  dynamic allocation 
  119. allowed the maximum length of an identifier to be increased to 29 
  120. bytes.  In NXREF,  this length  is  determined  by  the  printout 
  121. format rather than the structure that holds the references.  
  122.  
  123.     Upon realizing that a similar facility would be useful for C 
  124. programs, I modified NXREF into CXREF.  Since, from the viewpoint 
  125. of structure and cross-reference, the differences between Pascal 
  126. and C are slight, it was a relatively simple modification.
  127.  
  128.     CXREF200 and beyond have been converted to  C  with  CXREF200 
  129. being  in Datalight C.  Future releases of this program may be in 
  130. some other C source.  
  131.  
  132.  
  133.  
  134.  
  135.